# Image of frontend/: the built Astro site, served by astro preview.
# Built from the root of the repo (compose.yaml, or podman build -f frontend/Containerfile .).
# pnpm through corepack, never a global npm install; a non-root user ([HARDENED-CONTAINERS]).
FROM docker.io/library/node:24-slim
RUN corepack enable
WORKDIR /srv/frontend
COPY frontend/package.json frontend/pnpm-lock.yaml frontend/pnpm-workspace.yaml ./
RUN pnpm install --frozen-lockfile --ignore-scripts
COPY frontend/ ./
RUN pnpm build && chown -R node /srv
USER node
EXPOSE 4321
CMD ["pnpm", "preview", "--host", "0.0.0.0", "--port", "4321"]
